<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" v-model="username" placeholder="用户名">
    {{username}}
    <button>登录</button>
    <button @click="editUserName">修改用户名</button>
    <script>
        createVue({
            data(){
                return{
                    username:""
                }
            },
            methods:{
                editUserName(){
                    this.username = "tom"
                }
            }
        })
    </script>
</body>
</html>